package com.smh.a06comprehensiveExercises;

import java.util.StringJoiner;

public class Test3 {
    public static void main(String[] args) {

        int i = 10;
        StringJoiner stringJoiner = new StringJoiner("");
        StringBuilder stringBuilder = new StringBuilder();
        while (i!=0){

            int b = i%2;
            stringBuilder.append(b);
//            stringBuilder.insert(0,b);
//            stringJoiner = stringJoiner.add(new String(String.valueOf(b)));
            i=i/2;
        }
        StringBuilder reverse = stringBuilder.reverse();
        System.out.println(reverse.toString());


    }
}
